/*
* ============================================================================
*  Name     : CTagChangerContainer from TagChangerContainer.h
*  Part of  : TagChanger
*  Created  : 2007/10/27 by Ma811ok@gamil.com
*  Description:
*     Declares container control for application.
*  Version  :
*  Copyright: Ma811ok@gamil.com
* ============================================================================
*/

#ifndef TAGCHANGERCONTAINER_H
#define TAGCHANGERCONTAINER_H

// INCLUDES
#include <coecntrl.h>

// FORWARD DECLARATIONS
class MEikCommandObserver;		
class CAknSingleStyleListBox;
class CEikTextListBox;
class CTagEngine;				
class CListFileEngine;			// For list files in specific folder
class CTagDialog;				// For display Media tag information
class CGulIcon;

/**
*  CTagChangerContainer  container control class.
*  
*/
class CTagChangerContainer : public CCoeControl, MCoeControlObserver
{
public: // Constructors and destructor
	
        /**
        * EPOC default constructor.
        * @param aRect Frame rectangle for container.
	*/
	void ConstructL(const TRect& aRect, const TFileName& aPath);
	
	/**
	* Destructor.
	*/
	~CTagChangerContainer();
	
public: // New functions
	static void AddListBoxItemL(
		CEikTextListBox* aListBox,
		const TDesC& aString);
	
	static RArray< TInt >* GetSelectedListBoxItemsLC( CEikTextListBox* aListBox );
	
	static void DeleteSelectedListBoxItemsL( CEikTextListBox* aListBox );
	
	CAknSingleStyleListBox* ListBox();
	
	static void CreateListBoxItemL( TDes& aBuffer, 
		const TDesC& aMainText );
	
	void AddListBoxResourceArrayItemL( TInt aResourceId );
	
	void SetupListBoxIconsL();
	
	TBool HandleMarkableListCommandL( TInt aCommand );

	void SetFileList(const TDesC& aDirectory);
	
public: // Functions from base classes
	TKeyResponse    OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);

	// Handle menu command
	void HandleCommandL(TInt aCommand);
	
private: // Functions from base classes
	void InitializeControlsL();
	
	void LayoutControls();
	
	/**
	* From CoeControl,SizeChanged.
	*/
	void SizeChanged();
	
	/**
	* From CoeControl,CountComponentControls.
	*/
	TInt CountComponentControls() const;
	
	/**
	* From CCoeControl,ComponentControl.
	*/
	CCoeControl* ComponentControl(TInt aIndex) const;
	
	/**
	* From CCoeControl,Draw.
	*/
	void Draw(const TRect& aRect) const;
	
	/**
	* From ?base_class ?member_description
	*/
	// event handling section
	// e.g Listbox events
	void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);

	void ShowMessageL(const TDesC& aMessage);

	void ShowTagInfor(TBool aEditable);

private: //data
	CAknSingleStyleListBox* iListBox;

	CListFileEngine*		iListFile;

	CTagEngine*				iTagEngine;
};

#endif

// End of File
